package com.woniuxy.controller;

import com.woniuxy.entity.SwaggerTestEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Leimin
 * @date 2022/04/26 14:39
 **/
@RestController
@RequestMapping("/api")
@Api(tags = "标准演示接口")
public class SwaggerTestController {

    @PostMapping("/test")
    @ApiOperation(value = "接受json参数", notes = "演示json参数是否接受成功")
    public String post(@ApiParam(name = "entity", value="实体类",required=true)
                       @RequestBody SwaggerTestEntity entity){
        System.out.println(entity);

        return "测试成功";
    }
}

